Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

359
Vistas
Hello Why am I getting InvalidArgumentError: H.Map (Argument #0 [object Object])

I get this error when I try to display the data.I would like to retrieve and display the stations around me.here is my code.I get this as an error nvalidArgumentError: H.map.AbstractMarker#setGeometry (Argument #0 [object Object])

const requestStations=()=>{
    
   var center=JSON.parse(localStorage.getItem('center'));  
   
   var url = `https://browse.search.hereapi.com/v1/browse?apiKey=f-jhHQAK5b0Fykw9GhBPn2XIhyLUq9INnxN5Er0aY28&at=${center.coordinates[1]},${center.coordinates[0]}&limit=5&categories=400-4100-0035`;

   return new Promise((resolve, reject) => {fetch(url, {
         method: 'get',
      }).then((response) =>
         response.json().then((response) => {

            let markerGroup = new H.map.Group();
            let markers=[];
            alert(response.items[0].title);
            console.log(response.items[1].title);
            response.items.forEach((station) => {
               let marker = new H.map.Marker({lat:station.access.lat,lng:station.access.lng});
               markerGroup.addObject(marker);
               //alert(JSON.stringify({lat:station.coord.lat,lng:station.coord.lon}));
               markers.push(marker);
            });
            
            map.addObject(markerGroup);
            map.getViewModel().setLookAtData({
               bounds: markerGroup.getBoundingBox()
            });
            resolve(markers)

         })).catch(error=>{
            alert(error);
            reject(error);
            console.log(error);}
         
      )});
      
  }
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda